﻿
using BCCommon;
using BCCommon.Enums;
using BCData.Website.UserAddress;
using BCDto.Website.UserAddress;
using BCEntity.Website.UserAddress;
using BCService.Utils;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace BCService.Website.UserAddress
{
    /// <summary>
    /// 用户地址
    /// </summary>
    public interface IUserAddressService
    {
        #region  成员方法
        /// <summary>
        /// 是否存在此记录
        /// </summary>
        /// <param name="userAddressId">用户地址Id</param>
        bool Exists(long userAddressId);
        /// <summary>
        /// 添加用户地址
        /// </summary>
        /// <param name="requestDto">用户地址信息</param>
        UserAddressDto Add(UserAddressRequestDto requestDto);
        /// <summary>
        /// 更新用户地址
        /// </summary>
        /// <param name="putDto">用户地址信息</param>
        UserAddressDto Update(UserAddressPutDto putDto);
        /// <summary>
        /// 设置默认地址
        /// </summary>
        /// <param name="userAddressId">用户地址Id</param>
        /// <returns></returns>
        bool SettingIsDefault(long userAddressId);
        /// <summary>
        /// 删除用户地址
        /// </summary>
        /// <param name="userAddressId">用户地址Id</param>
        bool Delete(long userAddressId);
        /// <summary>
        /// 获取用户地址
        /// </summary>
        /// <param name="userAddressId">用户地址Id</param>
        UserAddressDto Get(long userAddressId);
        /// <summary>
        /// 获取用户地址总数
        /// </summary>
        /// <param name="userId">用户Id</param>
        int Count(long userId);
        /// <summary>
        /// 获取用户地址列表
        /// </summary>
        /// <param name="userId">用户Id</param>
        IEnumerable<UserAddressDto> GetList(long userId);
        /// <summary>
        /// 获取用户地址分页列表
        /// </summary>
        /// <param name="userId">用户Id</param>
        /// <param name="start">开始时间</param>
        /// <param name="end">结束时间</param>
        /// <param name="sortName">排序字段</param>
        /// <param name="ascending">升序</param>
        /// <param name="pageIndex">当前页码</param>
        /// <param name="pageSize">用户地址每页数据条数</param>
        PageableList<UserAddressDto> Query(long? userId, DateTime? start, DateTime? end, string sortName, bool? ascending, int pageIndex, int pageSize);
        #endregion  成员方法
    }
}